<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- react底层核心库 -->
    <script src="https://unpkg.com/react@17/umd/react.development.js"></script>
    <!-- react操作DOM的核心库，类似于jquery -->
    <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
    <!-- 用于解析babel -->
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>

<body>
    <!-- 
        react渲染三步走
        1、定义一个容器，存放虚拟DOM
        2、创建虚拟DOM元素
        3、把虚拟DOM元素渲染到页面上
     -->
    <div id="root1"></div>


    <script type="text/babel">
        //ES6方法创建必须使用type=text/babel
        //babel会把JSX转义为一个名为React.createElement()函数调用
        ReactDOM.render(
            <ul>
                <li className='lili'>111</li>
                <li>222</li>
            </ul>,
            document.getElementById('root1')
        )

    </script>

    <div id="root2"></div>
    <script type="text/babel">
        let div = <div className='hello'><h1>hello React</h1></div>
        ReactDOM.render(div,document.getElementById('root2'))
    </script>

</body>

</html>